package com.hn.dao;

import com.hn.mapper.StudentMapper;
import com.hn.pojo.Student;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * @作者 : wangchangdian
 * @创建时间 : 2019/3/26 - 22:11
 */
@Repository("studentDao")
public class StudentDao {
    @Resource
    StudentMapper studentMapper;

    //添加学生信息
    public void addStu(Student student) {
        studentMapper.addStu(student);
    }

    //根据学号和姓名查询学生
    public Student findStu(int ID) {
        return studentMapper.findStu(ID);
    }

    //查询所有学生
    public List<Student> findAllStu() {
        return studentMapper.findAllStu();

    }

    //修改学生信息
    public void editStu(Student StuName) {
        studentMapper.editStu(StuName);
    }

    //根据学号删除学生
    public void deleteStu(int ID) {
        studentMapper.deleteStu(ID);
    }

    //  模糊查询
   public List<Student> findLikeStu(String content){
        return studentMapper.findLikeStu(content);
   }

}
